<div class="fm-content">
  <!-- 最上面标题栏 -->
  <div class="title">
    <i nz-icon [type]="'desktop'"></i>
    &nbsp;&nbsp;统一待办
  </div>
  <!-- 内容 -->
  <div class="work">

    <!-- 查询框 -->
    <div class="top">
      <input nz-input placeholder="分类" class="fm-input first-input" [(ngModel)]="fs.queryObject['group:like']" />
      <input nz-input placeholder="流程名称" class="fm-input" [(ngModel)]="fs.queryObject['actdefname:like']" />
      <input nz-input placeholder="业务名称" class="fm-input" [(ngModel)]="fs.queryObject['sbusiness:like']" />
      <nz-button-group>
        <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
        <button nz-button (click)="fs.resetQueryObject() && fs.loadData(true)">重置</button>
      </nz-button-group>
      <div class="tool-right">
        <nz-button-group>
          <button nz-button [nzType]="'primary'" (click)="fs.addRow()">新增</button>
          <button nz-button (click)="fs.editRow()">编辑</button>
          <button nz-popconfirm nzTitle="确认删除选择项?" (nzOnConfirm)="fs.delEntitys()" nzPlacement="bottomRight"
            nz-button>删除</button>
        </nz-button-group>
      </div>
    </div>

    <!-- 右则样表单主体 -->
    <div class="work-content">
      <div class="table">
        <nz-table nzSize="middle" nzShowSizeChanger [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]'
          [nzFrontPagination]="false" [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing"
          [nzTotal]="fs.rowsCount" [(nzPageIndex)]="fs.pageIndex" [(nzPageSize)]="fs.pageSize"
          (nzPageIndexChange)="fs.loadData()" (nzPageSizeChange)="fs.loadData(true)">
          <thead>
            <tr>
              <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="fs.allChecked" [nzIndeterminate]="fs.indeterminate"
                (nzCheckedChange)="fs.checkAll($event)"></th>
              <th nzWidth="20%">名称</th>
              <th nzWidth="15%">流程</th>
              <th nzWidth="15%">表单</th>
              <th nzWidth="15%">提交信息</th>
              <th nzWidth="15%">审批人</th>
              <th nzWidth="15%">是否已读</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let data of fs.datas">
              <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="fs.refreshCheckStatus()">
              </td>
              <td>
                <span (click)="fs.editRow(data)" class="form-edit">
                  [{{data.group}}]{{data.sbusiness}}<br />
                  <span style="font-size: 12px;">({{data.waittime}})</span>
                </span>
              </td>
              <td>{{data.actdefname}}-{{data.taskdefname}}</td>
              <td><span (click)="bpmEdit(data)" class="form-edit">{{data.prjurl}}<br />{{data.prjvi}}</span></td>
              <td>{{data.tjusernames}}<br />{{data.fromtime | date:'yyyy-MM-dd HH:mm:ss' }}</td>
              <td>{{data.toptassigneesename}}</td>
              <td>{{data.sread}}</td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </div>

    <nz-modal nzWidth='830' nzTitle="编辑" [nzMaskClosable]='false' [nzFooter]="null" [(nzVisible)]="fs.isEditVisible"
      (nzOnCancel)="fs.closeEdit()">
      <form nz-form [nzLayout]="'inline'">
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">分类</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="group.invalid?'error':'success'" nzHasFeedback>
                <input nz-input [(ngModel)]="fs.er.group" name="group" required #group="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">流程实例</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.sexeid}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">流程ID</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.actdefid}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">流程名称</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.actdefname" name="actdefname" #actdefname="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">节点ID</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.taskdefid}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">节点名称</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.taskdefname" name="taskdefname" #taskdefname="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">访问URL</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.prjurl" name="prjurl" #prjurl="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">表单</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.prjvi" name="prjvi" #prjvi="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">业务ID</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.sbussinessid}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">业务名称</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.sbusiness" name="sbusiness" #sbusiness="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">提交人ID</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.tjuserids" name="tjuserids" #tjuserids="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">提交人</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.tjusernames" name="tjusernames" #tjusernames="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">审批人ID</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.toptassigneese" name="toptassigneese" #toptassigneese="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">审批人</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.toptassigneesename" name="toptassigneesename"
                  #toptassigneesename="ngModel" />
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">启动时间</nz-form-label>
              <nz-form-control class="form-control">
                <nz-date-picker nzShowTime [(ngModel)]="fs.er.fromtime" name="fromtime" #fromtime="ngModel">
                </nz-date-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">属性</nz-form-label>
              <nz-form-control class="form-control">
                <label nz-checkbox [(ngModel)]="fs.er.sread" name="sread">已读</label>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24" class="form-button-align">
            <button nz-button nzType="default" (click)="fs.closeEdit()" class="form-button">取消</button>
            <button nz-button nzType="primary" [disabled]='group.invalid' (click)="fs.save()"
              [nzLoading]="fs.isSaveing">保存</button>
          </div>
        </div>
      </form>
    </nz-modal>
  </div>
</div>
